//
//  SFMovableView.m
//  TableViewFramework
//
//  Created by 支晓辉 on 16/3/30.
//  Copyright © 2016年 wishselfly. All rights reserved.
//

#import "SFMovableView.h"

@interface SFMovableView ()
/** 长按手势 */
@property (strong, nonatomic) UILongPressGestureRecognizer *gesture;

@property (strong, nonatomic, readwrite) NSString *reuseIdentifier;

@end

@implementation SFMovableView
@synthesize reuseIdentifier = _reuseIdentifier;

#pragma mark - init

- (instancetype)init {
    if (self = [super init]) {
        [self _initView];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self _initView];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        [self _initView];
    }
    return self;
}

#pragma mark - Private methods

/**
 *  初始化视图
 */
- (void)_initView {
    
}

#pragma mark - Getters

+ (CGFloat)rowHeight {
    return 50.f;
}

#pragma mark - Seeters

- (void)setIsMoving:(BOOL)isMoving {
    _isMoving = isMoving;
    super.alpha = isMoving ? 0.f:1.f;
}

- (void)setAlpha:(CGFloat)alpha {
    if (self.isMoving) {
        super.alpha = 0.f;
    } else {
        super.alpha = alpha;
    }
}

@end
